﻿Imports System.Runtime.InteropServices

Public Class Form1
    Dim clean As Cleaner
    Dim abt As About
    Dim pro As Processes
    <StructLayout(LayoutKind.Sequential)> _
    Public Structure MARGINS
        Public cxLeftWidth As Integer
        Public cxRightWidth As Integer
        Public cyTopHeight As Integer
        Public cyButtomheight As Integer
    End Structure
    <DllImport("dwmapi.dll")> _
    Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As MARGINS) As Integer
    End Function
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Panel1.Controls.Clear()
        Panel1.Controls.Add(clean)
        Dim margins As MARGINS = New MARGINS
        margins.cxLeftWidth = 0
        margins.cxRightWidth = 0
        margins.cyTopHeight = 115
        margins.cyButtomheight = 11
        'set all the four value -1 to apply glass effect to the whole window
        'set your own value to make specific part of the window glassy.
        Dim hwnd As IntPtr = Me.Handle
        Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
        'Me.TransparencyKey = Color.FromKnownColor(KnownColor.ActiveCaptionText)
        'Me.BackColor = Color.Black
    End Sub
    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()
        application.checkosandend()
        ' Add any initialization after the InitializeComponent() call.
        clean = New Cleaner
        abt = New About
        pro = New Processes
        'MsgBox(My.Computer.FileSystem.SpecialDirectories.Temp)
        'MsgBox(temperaoryfolder.GetInternetfilesfolder())

    End Sub

    Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        Panel1.Controls.Clear()
        Panel1.Controls.Add(clean)
        picselonx.Image = My.Resources.zune_blue
    End Sub

    Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblabout.Click
        Panel1.Controls.Clear()
        Panel1.Controls.Add(abt)
        picselonx.Image = My.Resources.zune_red
        lblabout.ForeColor = Color.DimGray
        lblcleaner.ForeColor = Color.Silver
        lblprocess.ForeColor = Color.Silver
        underbar.Width = lblabout.Width - 20
        underbar.Location = New Point(lblabout.Location.X + 10, underbar.Location.Y)
    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblcleaner.Click
        Panel1.Controls.Clear()
        Panel1.Controls.Add(clean)
        picselonx.Image = My.Resources.zune_blue
        lblabout.ForeColor = Color.Silver
        lblcleaner.ForeColor = Color.DimGray
        lblprocess.ForeColor = Color.Silver
        underbar.Width = lblcleaner.Width - 20
        underbar.Location = New Point(lblcleaner.Location.X + 10, underbar.Location.Y)
    End Sub

    Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblprocess.Click
        Panel1.Controls.Clear()
        Panel1.Controls.Add(pro)
        picselonx.Image = My.Resources.zune_orange
        lblabout.ForeColor = Color.Silver
        lblcleaner.ForeColor = Color.Silver
        lblprocess.ForeColor = Color.DimGray
        underbar.Width = lblprocess.Width - 20
        underbar.Location = New Point(lblprocess.Location.X + 10, underbar.Location.Y)
    End Sub
End Class
